package service;

import javax.xml.rpc.JAXRPCException;
import javax.xml.namespace.QName;
import javax.microedition.xml.rpc.Operation;
import javax.microedition.xml.rpc.Type;
import javax.microedition.xml.rpc.ComplexType;
import javax.microedition.xml.rpc.Element;

public class GetMyStuffService_Stub implements GetMyStuffService, javax.xml.rpc.Stub {

    private String[] _propertyNames;
    private Object[] _propertyValues;

    public GetMyStuffService_Stub() {
        _propertyNames = new String[] { ENDPOINT_ADDRESS_PROPERTY };
        _propertyValues = new Object[] { "http://localhost:8080/MRCServer/GetMyStuffService" };
    }

    public void _setProperty( String name, Object value ) {
        int size = _propertyNames.length;
        for (int i = 0; i < size; ++i) {
            if( _propertyNames[i].equals( name )) {
                _propertyValues[i] = value;
                return;
            }
        }
        String[] newPropNames = new String[size + 1];
        System.arraycopy(_propertyNames, 0, newPropNames, 0, size);
        _propertyNames = newPropNames;
        Object[] newPropValues = new Object[size + 1];
        System.arraycopy(_propertyValues, 0, newPropValues, 0, size);
        _propertyValues = newPropValues;

        _propertyNames[size] = name;
        _propertyValues[size] = value;
    }

    public Object _getProperty(String name) {
        for (int i = 0; i < _propertyNames.length; ++i) {
            if (_propertyNames[i].equals(name)) {
                return _propertyValues[i];
            }
        }
        if (ENDPOINT_ADDRESS_PROPERTY.equals(name) || USERNAME_PROPERTY.equals(name) || PASSWORD_PROPERTY.equals(name)) {
            return null;
        }
        if (SESSION_MAINTAIN_PROPERTY.equals(name)) {
            return new Boolean(false);
        }
        throw new JAXRPCException("Stub does not recognize property: " + name);
    }

    protected void _prepOperation(Operation op) {
        for (int i = 0; i < _propertyNames.length; ++i) {
            op.setProperty(_propertyNames[i], _propertyValues[i].toString());
        }
    }

    public String[] getNearLocation(String location) throws java.rmi.RemoteException {
        Object inputObject[] = new Object[] {
            location
        };

        Operation op = Operation.newInstance( _qname_operation_getNearLocation, _type_getNearLocation, _type_getNearLocationResponse );
        _prepOperation( op );
        op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "" );
        Object resultObj;
        try {
            resultObj = op.invoke( inputObject );
        } catch( JAXRPCException e ) {
            Throwable cause = e.getLinkedCause();
            if( cause instanceof java.rmi.RemoteException ) {
                throw (java.rmi.RemoteException) cause;
            }
            return null;
        }

        String[] _res = new String[((Object [])((Object []) resultObj)[0]).length];
        System.arraycopy(((Object []) resultObj)[0], 0, _res, 0, _res.length);
        return _res;
    }

    public String[] getPOIsByKW(String keyword) throws java.rmi.RemoteException {
        Object inputObject[] = new Object[] {
            keyword
        };

        Operation op = Operation.newInstance( _qname_operation_getPOIsByKW, _type_getPOIsByKW, _type_getPOIsByKWResponse );
        _prepOperation( op );
        op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "" );
        Object resultObj;
        try {
            resultObj = op.invoke( inputObject );
        } catch( JAXRPCException e ) {
            Throwable cause = e.getLinkedCause();
            if( cause instanceof java.rmi.RemoteException ) {
                throw (java.rmi.RemoteException) cause;
            }
            return null;
        }

        String[] _res = new String[((Object [])((Object []) resultObj)[0]).length];
        System.arraycopy(((Object []) resultObj)[0], 0, _res, 0, _res.length);
        return _res;
    }

    public String[] getTravelByKW(String keyword) throws java.rmi.RemoteException {
        Object inputObject[] = new Object[] {
            keyword
        };

        Operation op = Operation.newInstance( _qname_operation_getTravelByKW, _type_getTravelByKW, _type_getTravelByKWResponse );
        _prepOperation( op );
        op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "" );
        Object resultObj;
        try {
            resultObj = op.invoke( inputObject );
        } catch( JAXRPCException e ) {
            Throwable cause = e.getLinkedCause();
            if( cause instanceof java.rmi.RemoteException ) {
                throw (java.rmi.RemoteException) cause;
            }
            return null;
        }

        String[] _res = new String[((Object [])((Object []) resultObj)[0]).length];
        System.arraycopy(((Object []) resultObj)[0], 0, _res, 0, _res.length);
        return _res;
    }

    public String[] getHostingByKW(String keyword) throws java.rmi.RemoteException {
        Object inputObject[] = new Object[] {
            keyword
        };

        Operation op = Operation.newInstance( _qname_operation_getHostingByKW, _type_getHostingByKW, _type_getHostingByKWResponse );
        _prepOperation( op );
        op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "" );
        Object resultObj;
        try {
            resultObj = op.invoke( inputObject );
        } catch( JAXRPCException e ) {
            Throwable cause = e.getLinkedCause();
            if( cause instanceof java.rmi.RemoteException ) {
                throw (java.rmi.RemoteException) cause;
            }
            return null;
        }

        String[] _res = new String[((Object [])((Object []) resultObj)[0]).length];
        System.arraycopy(((Object []) resultObj)[0], 0, _res, 0, _res.length);
        return _res;
    }

    public String[] getEatingByKW(String keyword) throws java.rmi.RemoteException {
        Object inputObject[] = new Object[] {
            keyword
        };

        Operation op = Operation.newInstance( _qname_operation_getEatingByKW, _type_getEatingByKW, _type_getEatingByKWResponse );
        _prepOperation( op );
        op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "" );
        Object resultObj;
        try {
            resultObj = op.invoke( inputObject );
        } catch( JAXRPCException e ) {
            Throwable cause = e.getLinkedCause();
            if( cause instanceof java.rmi.RemoteException ) {
                throw (java.rmi.RemoteException) cause;
            }
            return null;
        }

        String[] _res = new String[((Object [])((Object []) resultObj)[0]).length];
        System.arraycopy(((Object []) resultObj)[0], 0, _res, 0, _res.length);
        return _res;
    }

    public String[] getNearCoord(String latitude, String longitude) throws java.rmi.RemoteException {
        Object inputObject[] = new Object[] {
            latitude,
            longitude
        };

        Operation op = Operation.newInstance( _qname_operation_getNearCoord, _type_getNearCoord, _type_getNearCoordResponse );
        _prepOperation( op );
        op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "" );
        Object resultObj;
        try {
            resultObj = op.invoke( inputObject );
        } catch( JAXRPCException e ) {
            Throwable cause = e.getLinkedCause();
            if( cause instanceof java.rmi.RemoteException ) {
                throw (java.rmi.RemoteException) cause;
            }
            return null;
        }

        String[] _res = new String[((Object [])((Object []) resultObj)[0]).length];
        System.arraycopy(((Object []) resultObj)[0], 0, _res, 0, _res.length);
        return _res;
    }

    public String getPOIbyID(int poiID) throws java.rmi.RemoteException {
        Object inputObject[] = new Object[] {
            new Integer(poiID)
        };

        Operation op = Operation.newInstance( _qname_operation_getPOIbyID, _type_getPOIbyID, _type_getPOIbyIDResponse );
        _prepOperation( op );
        op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "" );
        Object resultObj;
        try {
            resultObj = op.invoke( inputObject );
        } catch( JAXRPCException e ) {
            Throwable cause = e.getLinkedCause();
            if( cause instanceof java.rmi.RemoteException ) {
                throw (java.rmi.RemoteException) cause;
            }
            return null;
        }

        return (String )((Object[])resultObj)[0];
    }

    public String[] getOrdersByMobNumber(String phoneNumber) throws java.rmi.RemoteException {
        Object inputObject[] = new Object[] {
            phoneNumber
        };

        Operation op = Operation.newInstance( _qname_operation_getOrdersByMobNumber, _type_getOrdersByMobNumber, _type_getOrdersByMobNumberResponse );
        _prepOperation( op );
        op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "" );
        Object resultObj;
        try {
            resultObj = op.invoke( inputObject );
        } catch( JAXRPCException e ) {
            Throwable cause = e.getLinkedCause();
            if( cause instanceof java.rmi.RemoteException ) {
                throw (java.rmi.RemoteException) cause;
            }
            return null;
        }

        String[] _res = new String[((Object [])((Object []) resultObj)[0]).length];
        System.arraycopy(((Object []) resultObj)[0], 0, _res, 0, _res.length);
        return _res;
    }

    public Boolean makeOrder(String[] orderDetails) throws java.rmi.RemoteException {
        Object inputObject[] = new Object[] {
            orderDetails
        };

        Operation op = Operation.newInstance( _qname_operation_makeOrder, _type_makeOrder, _type_makeOrderResponse );
        _prepOperation( op );
        op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "" );
        Object resultObj;
        try {
            resultObj = op.invoke( inputObject );
        } catch( JAXRPCException e ) {
            Throwable cause = e.getLinkedCause();
            if( cause instanceof java.rmi.RemoteException ) {
                throw (java.rmi.RemoteException) cause;
            }
            return null;
        }

        return (Boolean )((Object[])resultObj)[0];
    }

    protected static final QName _qname_operation_makeOrder = new QName( "http://ws/", "makeOrder" );
    protected static final QName _qname_operation_getPOIbyID = new QName( "http://ws/", "getPOIbyID" );
    protected static final QName _qname_operation_getOrdersByMobNumber = new QName( "http://ws/", "getOrdersByMobNumber" );
    protected static final QName _qname_operation_getEatingByKW = new QName( "http://ws/", "getEatingByKW" );
    protected static final QName _qname_operation_getNearCoord = new QName( "http://ws/", "getNearCoord" );
    protected static final QName _qname_operation_getHostingByKW = new QName( "http://ws/", "getHostingByKW" );
    protected static final QName _qname_operation_getTravelByKW = new QName( "http://ws/", "getTravelByKW" );
    protected static final QName _qname_operation_getPOIsByKW = new QName( "http://ws/", "getPOIsByKW" );
    protected static final QName _qname_operation_getNearLocation = new QName( "http://ws/", "getNearLocation" );
    protected static final QName _qname_makeOrderResponse = new QName( "http://ws/", "makeOrderResponse" );
    protected static final QName _qname_getPOIbyIDResponse = new QName( "http://ws/", "getPOIbyIDResponse" );
    protected static final QName _qname_getNearCoordResponse = new QName( "http://ws/", "getNearCoordResponse" );
    protected static final QName _qname_getOrdersByMobNumber = new QName( "http://ws/", "getOrdersByMobNumber" );
    protected static final QName _qname_getEatingByKWResponse = new QName( "http://ws/", "getEatingByKWResponse" );
    protected static final QName _qname_getEatingByKW = new QName( "http://ws/", "getEatingByKW" );
    protected static final QName _qname_getNearCoord = new QName( "http://ws/", "getNearCoord" );
    protected static final QName _qname_getTravelByKWResponse = new QName( "http://ws/", "getTravelByKWResponse" );
    protected static final QName _qname_getPOIsByKWResponse = new QName( "http://ws/", "getPOIsByKWResponse" );
    protected static final QName _qname_getPOIsByKW = new QName( "http://ws/", "getPOIsByKW" );
    protected static final QName _qname_getOrdersByMobNumberResponse = new QName( "http://ws/", "getOrdersByMobNumberResponse" );
    protected static final QName _qname_getNearLocation = new QName( "http://ws/", "getNearLocation" );
    protected static final QName _qname_getNearLocationResponse = new QName( "http://ws/", "getNearLocationResponse" );
    protected static final QName _qname_makeOrder = new QName( "http://ws/", "makeOrder" );
    protected static final QName _qname_getHostingByKWResponse = new QName( "http://ws/", "getHostingByKWResponse" );
    protected static final QName _qname_getPOIbyID = new QName( "http://ws/", "getPOIbyID" );
    protected static final QName _qname_getHostingByKW = new QName( "http://ws/", "getHostingByKW" );
    protected static final QName _qname_getTravelByKW = new QName( "http://ws/", "getTravelByKW" );
    protected static final Element _type_getOrdersByMobNumberResponse;
    protected static final Element _type_getNearCoordResponse;
    protected static final Element _type_getHostingByKWResponse;
    protected static final Element _type_getEatingByKW;
    protected static final Element _type_getNearLocation;
    protected static final Element _type_getTravelByKWResponse;
    protected static final Element _type_getNearLocationResponse;
    protected static final Element _type_getEatingByKWResponse;
    protected static final Element _type_makeOrder;
    protected static final Element _type_getPOIbyID;
    protected static final Element _type_makeOrderResponse;
    protected static final Element _type_getTravelByKW;
    protected static final Element _type_getHostingByKW;
    protected static final Element _type_getPOIbyIDResponse;
    protected static final Element _type_getNearCoord;
    protected static final Element _type_getPOIsByKW;
    protected static final Element _type_getPOIsByKWResponse;
    protected static final Element _type_getOrdersByMobNumber;

    static {
        _type_makeOrderResponse = new Element( _qname_makeOrderResponse, _complexType( new Element[] {
            new Element( new QName( "", "return" ), Type.BOOLEAN, 0, 1, false )}), 1, 1, false );
        _type_getPOIbyIDResponse = new Element( _qname_getPOIbyIDResponse, _complexType( new Element[] {
            new Element( new QName( "", "return" ), Type.STRING, 0, 1, false )}), 1, 1, false );
        _type_getNearCoordResponse = new Element( _qname_getNearCoordResponse, _complexType( new Element[] {
            new Element( new QName( "", "return" ), Type.STRING, 0, Element.UNBOUNDED, true )}), 1, 1, false );
        _type_getOrdersByMobNumber = new Element( _qname_getOrdersByMobNumber, _complexType( new Element[] {
            new Element( new QName( "", "phoneNumber" ), Type.STRING, 0, 1, false )}), 1, 1, false );
        _type_getEatingByKWResponse = new Element( _qname_getEatingByKWResponse, _complexType( new Element[] {
            new Element( new QName( "", "return" ), Type.STRING, 0, Element.UNBOUNDED, true )}), 1, 1, false );
        _type_getEatingByKW = new Element( _qname_getEatingByKW, _complexType( new Element[] {
            new Element( new QName( "", "keyword" ), Type.STRING, 0, 1, false )}), 1, 1, false );
        _type_getNearCoord = new Element( _qname_getNearCoord, _complexType( new Element[] {
            new Element( new QName( "", "latitude" ), Type.STRING, 0, 1, false ),
            new Element( new QName( "", "longitude" ), Type.STRING, 0, 1, false )}), 1, 1, false );
        _type_getTravelByKWResponse = new Element( _qname_getTravelByKWResponse, _complexType( new Element[] {
            new Element( new QName( "", "return" ), Type.STRING, 0, Element.UNBOUNDED, true )}), 1, 1, false );
        _type_getPOIsByKWResponse = new Element( _qname_getPOIsByKWResponse, _complexType( new Element[] {
            new Element( new QName( "", "return" ), Type.STRING, 0, Element.UNBOUNDED, true )}), 1, 1, false );
        _type_getPOIsByKW = new Element( _qname_getPOIsByKW, _complexType( new Element[] {
            new Element( new QName( "", "keyword" ), Type.STRING, 0, 1, false )}), 1, 1, false );
        _type_getOrdersByMobNumberResponse = new Element( _qname_getOrdersByMobNumberResponse, _complexType( new Element[] {
            new Element( new QName( "", "return" ), Type.STRING, 0, Element.UNBOUNDED, true )}), 1, 1, false );
        _type_getNearLocation = new Element( _qname_getNearLocation, _complexType( new Element[] {
            new Element( new QName( "", "location" ), Type.STRING, 0, 1, false )}), 1, 1, false );
        _type_makeOrder = new Element( _qname_makeOrder, _complexType( new Element[] {
            new Element( new QName( "", "orderDetails" ), Type.STRING, 0, Element.UNBOUNDED, true )}), 1, 1, false );
        _type_getNearLocationResponse = new Element( _qname_getNearLocationResponse, _complexType( new Element[] {
            new Element( new QName( "", "return" ), Type.STRING, 0, Element.UNBOUNDED, true )}), 1, 1, false );
        _type_getHostingByKWResponse = new Element( _qname_getHostingByKWResponse, _complexType( new Element[] {
            new Element( new QName( "", "return" ), Type.STRING, 0, Element.UNBOUNDED, true )}), 1, 1, false );
        _type_getPOIbyID = new Element( _qname_getPOIbyID, _complexType( new Element[] {
            new Element( new QName( "", "poiID" ), Type.INT )}), 1, 1, false );
        _type_getHostingByKW = new Element( _qname_getHostingByKW, _complexType( new Element[] {
            new Element( new QName( "", "keyword" ), Type.STRING, 0, 1, false )}), 1, 1, false );
        _type_getTravelByKW = new Element( _qname_getTravelByKW, _complexType( new Element[] {
            new Element( new QName( "", "keyword" ), Type.STRING, 0, 1, false )}), 1, 1, false );
    }

    private static ComplexType _complexType( Element[] elements ) {
        ComplexType result = new ComplexType();
        result.elements = elements;
        return result;
    }
}
